package com.aisilesn.recruit.dao;

import com.aisilesn.recruit.pojo.Recruit;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @Author: Mr.liu
 * @Description:数据访问接口
 * @Date: Create in 18:55 2019/4/22
 */

public interface RecruitDao extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit> {
    //查询前4个  已发布日期降序  state为 2
    List<Recruit> findTop4ByStateOrderByCreatetimeDesc(String state);
    //查询前12个  已发布日期降序  state 不为0
    List<Recruit> findTop12ByStateNotOrderByCreatetimeDesc(String state);
}
